<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2018/11/8
 * Time: 15:00
 */
//连接数据库
$db = new mysqli('localhost', 'root', 'root', 'ilove');
//连接数据库
if ($db->connect_error) {
    die("连接失败: " . $db->connect_error);
}
$str = "SELECT * FROM iw_admin";
$res = $db->query($str);
if($res){
    foreach($res as $k => $v)
    {
        echo $v['id'] . " " . $v['username'].''.$v['last_ip'];
        echo "<br>";
    }
}else{
    die("error: " .  $db->error);
}

